import { apiRequest as request } from '@/utils/axios';
import type { ApiFuncData, PageData, ResponseDataWithPager, Operator } from './types';

export interface CapitalManage {
  id: number;
  com_id: number;
  operate_id: number;
  year: number;
  month: number;
  pro_name: string;
  use_money: number;
  duration_month: number;
  know_month_money: number;
  operator: Operator;
  created_at: string;
  updated_at: string;
}

export interface CapitalManageReqQuery extends PageData {}

export interface CapitalManageReqData {
  year: number;
  month: number;
  pro_name: string;
  use_money: number;
  duration_month: number;
}

// 配置中心 财务管理 设备类型配置
export function capitalManage(data: ApiFuncData<CapitalManageReqData, CapitalManageReqQuery>) {
  return request<ResponseDataWithPager<CapitalManage>, CapitalManageReqData>({
    url: '/v7/capital-manage',
    method: 'get',
    ...data,
  });
}
